package com.example.httpservlet;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class HtmlTest {

    //页面直接返回字符串，http://localhost:7002/index
    @RequestMapping("/index")
    @ResponseBody
    public String index(){
        return "Hello World";
    }

    //返回名称为test.html的页面，http://localhost:7002/test
    @RequestMapping("/test")
    public String test(){
        return "test";
    }

}